Optimal. Leaf size=49 \[ -a^3 x+\frac {a^3 \tanh ^{-1}(\sin (c+d x))}{d}-\frac {4 a^3 \cot (c+d x)}{d}-\frac {4 a^3 \csc (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.07, antiderivative size = 49, normalized size of antiderivative = 1.00, number of steps
used = 11, number of rules used = 8, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.381, Rules used = {3971, 3554, 8,
2686, 3852, 2701, 327, 213} \begin {gather*} -\frac {4 a^3 \cot (c+d x)}{d}-\frac {4 a^3 \csc (c+d x)}{d}+\frac {a^3 \tanh ^{-1}(\sin (c+d x))}{d}+a^3 (-x) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 213
Rule 327
Rule 2686
Rule 2701
Rule 3554
Rule 3852
Rule 3971
Rubi steps
\begin {align*} \int \cot ^2(c+d x) (a+a \sec (c+d x))^3 \, dx &=\int \left (a^3 \cot ^2(c+d x)+3 a^3 \cot (c+d x) \csc (c+d x)+3 a^3 \csc ^2(c+d x)+a^3 \csc ^2(c+d x) \sec (c+d x)\right ) \, dx\\ &=a^3 \int \cot ^2(c+d x) \, dx+a^3 \int \csc ^2(c+d x) \sec (c+d x) \, dx+\left (3 a^3\right ) \int \cot (c+d x) \csc (c+d x) \, dx+\left (3 a^3\right ) \int \csc ^2(c+d x) \, dx\\ &=-\frac {a^3 \cot (c+d x)}{d}-a^3 \int 1 \, dx-\frac {a^3 \text {Subst}\left (\int \frac {x^2}{-1+x^2} \, dx,x,\csc (c+d x)\right )}{d}-\frac {\left (3 a^3\right ) \text {Subst}(\int 1 \, dx,x,\cot (c+d x))}{d}-\frac {\left (3 a^3\right ) \text {Subst}(\int 1 \, dx,x,\csc (c+d x))}{d}\\ &=-a^3 x-\frac {4 a^3 \cot (c+d x)}{d}-\frac {4 a^3 \csc (c+d x)}{d}-\frac {a^3 \text {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\csc (c+d x)\right )}{d}\\ &=-a^3 x+\frac {a^3 \tanh ^{-1}(\sin (c+d x))}{d}-\frac {4 a^3 \cot (c+d x)}{d}-\frac {4 a^3 \csc (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(109\) vs. \(2(49)=98\).
time = 0.25, size = 109, normalized size = 2.22 \begin {gather*} -\frac {a^3 (1+\cos (c+d x))^3 \sec ^6\left (\frac {1}{2} (c+d x)\right ) \left (d x+\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )-4 \csc \left (\frac {c}{2}\right ) \csc \left (\frac {1}{2} (c+d x)\right ) \sin \left (\frac {d x}{2}\right )\right )}{8 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.08, size = 79, normalized size = 1.61
method | result | size |
risch | \(-a^{3} x -\frac {8 i a^{3}}{d \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}-\frac {a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}+\frac {a^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}\) | \(71\) |
derivativedivides | \(\frac {a^{3} \left (-\frac {1}{\sin \left (d x +c \right )}+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )-3 a^{3} \cot \left (d x +c \right )-\frac {3 a^{3}}{\sin \left (d x +c \right )}+a^{3} \left (-\cot \left (d x +c \right )-d x -c \right )}{d}\) | \(79\) |
default | \(\frac {a^{3} \left (-\frac {1}{\sin \left (d x +c \right )}+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )-3 a^{3} \cot \left (d x +c \right )-\frac {3 a^{3}}{\sin \left (d x +c \right )}+a^{3} \left (-\cot \left (d x +c \right )-d x -c \right )}{d}\) | \(79\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.49, size = 85, normalized size = 1.73 \begin {gather*} -\frac {2 \, {\left (d x + c + \frac {1}{\tan \left (d x + c\right )}\right )} a^{3} + a^{3} {\left (\frac {2}{\sin \left (d x + c\right )} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + \frac {6 \, a^{3}}{\sin \left (d x + c\right )} + \frac {6 \, a^{3}}{\tan \left (d x + c\right )}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.16, size = 84, normalized size = 1.71 \begin {gather*} -\frac {2 \, a^{3} d x \sin \left (d x + c\right ) - a^{3} \log \left (\sin \left (d x + c\right ) + 1\right ) \sin \left (d x + c\right ) + a^{3} \log \left (-\sin \left (d x + c\right ) + 1\right ) \sin \left (d x + c\right ) + 8 \, a^{3} \cos \left (d x + c\right ) + 8 \, a^{3}}{2 \, d \sin \left (d x + c\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} a^{3} \left (\int 3 \cot ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int 3 \cot ^{2}{\left (c + d x \right )} \sec ^{2}{\left (c + d x \right )}\, dx + \int \cot ^{2}{\left (c + d x \right )} \sec ^{3}{\left (c + d x \right )}\, dx + \int \cot ^{2}{\left (c + d x \right )}\, dx\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.52, size = 66, normalized size = 1.35 \begin {gather*} -\frac {{\left (d x + c\right )} a^{3} - a^{3} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) + a^{3} \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) + \frac {4 \, a^{3}}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.20, size = 35, normalized size = 0.71 \begin {gather*} -\frac {a^3\,\left (4\,\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )-2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )+d\,x\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________